//编写程序，读取用户输入的一个整数作为年份，并且确定该年份是否为闰年（这样二月有29天）。如果年份能被4整除且不能被100整除，或者同时能被100和400整除则为闰年。
import java.util.Scanner;
public class pp5_1
{
  public static void main(String []args)
  {
   int year;
   final int MINYEAR = 1582;
   Scanner scan = new Scanner(System.in);
   //提示用户输入想测试的年份。
   System.out.println("Please input one year you want to test: ");
   year = scan.nextInt();

   if (year >= MINYEAR)
     if((year % 100 == 0)&&(year % 400 == 0))
       System.out.println("This year is a leap year. Congratulations.");
     else
       System.out.println("This year is NOT leap year.");
   else
     System.out.println("Please input a year after 1582AD.");
   }
}


